import React, { Component } from 'react';

import { Row, Col,notification } from 'antd';
import { Route } from 'react-router';
import cookies from 'react-cookies'

import CashierMenu from './CashierMenu/CashierMenu';
import CashierCreateOrder from './CashierCreateOrder/CashierCreateOrder';
import AntNav from './CashierNav/index';
import LastOrder from './LastOrder/LastOrder'
class Cashier extends Component {
    
    state = {
        cookie:document.cookie
    }

    componentWillMount =()=>{
        if(!cookies.load('userID')){
            this.props.history.replace('/login')
            notification['error']({
                message:'未登录',
                description:'登陆后放方可使用'
            })

        }

}

    render() {
        return (
            <div>
                <AntNav></AntNav>
                <Row>
                    <Col span={2}>
                        <Route path="/cashier" component={CashierMenu}></Route>
                    </Col>
                    <Col span={22}>
                        <Route path="/cashier/create" component={CashierCreateOrder}></Route>
                    </Col>
                    {/* <Col span={6}>
                        <Route path="/cashier/create" component={LastOrder}></Route>
                    </Col> */}
                </Row>
            </div>
        );
    }
}

export default Cashier;
